<template>
	<view>
		<view class="head">
			<view class="head_left" @tap="back()">
				<image src="../../../static/wode/return.png" mode=""></image>
				<text>返回</text>
			</view>
			<view class="head_mid">
				我的收益
			</view>
			<view class="head_right">
		
			</view>
		</view>
		<view class="body">
			<view class="body_top">
				<text class="text1">课程结算</text>
				<text class="text2">+{{moneyData.earnings}}元</text>
				<text class="text3" v-if="moneyData.earnings_status==1">未结算</text>
				<text class="text3" v-else>已结算</text>
			</view>
			<view class="">
				<view class="body_item">
					<text>教学身份</text>
					<text class="text4">{{moneyData.type}}</text>
				</view>
				<view class="body_item">
					<text>学生</text>
					<view class="people_Item">
						<text class="text4">{{studentinfo.nick_name}}</text>
						<image :src="studentinfo.avatar" mode=""></image>
					</view>
				</view>
				<view class="body_item">
					<text>类别</text>
					<text class="text4">{{moneyData.titletype}}</text>
				</view>
				<view class="className">
					《{{moneyData.titlename}}》
				</view>
				<view class="body_item">
					<text>上课时间</text>
					<text class="text4">{{moneyData.time}}</text>
				</view>
				<view class="body_item">
					<text>订单号</text>
					<text class="text4">{{moneyData.pipeline_num}}</text>
				</view>
				<view class="body_item">
					<text>备注</text>
					<text>{{moneyData.remarks}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',//收益数据id
				moneyData:'',
				studentinfo:'',
			}
		},
		onLoad(option) {
			this.id=option.id
			this.getData()
		},
		methods: {
			back(){
				uni.navigateBack({
					delta:1
				})
			},
			getData(){
				var me=this;
				var data={
					id:this.id,
					pageSize:1
				}
				this.myAjaxNew({
					model: 'user',
					controllerName: 'userAppointment',
					actionName: 'queryListPage',
					data: data,
					successBack: function(res) {
						console.log(res,'收益详情')
						me.moneyData=res.data.data[0]
						me.moneyData.earnings=me.moneyData.earnings.toFixed(2)
						me.studentinfo=me.moneyData.map.userinfo
						me.moneyData.title=me.moneyData.title.split('/')
						me.moneyData.titletype=me.moneyData.title[0]
						me.moneyData.titlename=me.moneyData.title[1]
						me.moneyData.start_time=me.moneyData.start_time.split(' ')
						me.moneyData.end_time=me.moneyData.end_time.split(' ')
						var timeNum = me.moneyData.start_time[1].substr(0, 5) + '~' + me.moneyData.end_time[1].substr(0, 5)
						me.moneyData.time = me.moneyData.start_time[0]+' '+timeNum
						console.log(me.moneyData.time,'时间')
						if(me.moneyData.master_type=='major'){
							me.moneyData.type='专业助学师'
						}else if(me.moneyData.master_type=='cross_border'){
							me.moneyData.type='跨境助学师'
						}else if(me.moneyData.master_type=='mother_tongue'){
							me.moneyData.type='母语助学师'
						}else if(me.moneyData.master_type=='private_education'){
							me.moneyData.type='私教'
						}else if(me.moneyData.master_type=='experience'){
							me.moneyData.type='体验'
						}
					},
				})
			},
		}
	}
</script>

<style scoped>
.head {
		width: 100%;
		display: flex;
		justify-content: space-between;
		height: 128upx;
		background: #ffffff;
		padding: 0 24upx;
		z-index: 200;
		position: fixed;
		top: 0;
	}

	.head image {
		width: 20upx;
		height: 36upx;
		margin-right: 9upx;
	}

	.head_left {
		height: 82upx;
		display: flex;
		align-items: center;
		line-height: 82upx;
		color: #666666;
		font-size: 32upx;

	}

	.head_right {
		width: 92upx;
	}
	.body{
		background: #FFFFFF;
	}
	.body_top{
		padding-top: 128upx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: 240upx;
	}
	.text1{
		color: #333333;
		font-size: 26upx;
	}
	.text2{
		color: #FCC732;
		font-size:46upx ;
		margin: 36upx 0 28upx 0;
	}
	.text3{
		color: #CCCCCC;
		font-size: 24upx;
	}
	.body_item{
		display: flex;
		justify-content: space-between;
		padding: 0 24upx;
		border-top: 1upx solid #E6E6E6;
		height: 88upx;
		line-height: 88upx;
		color: #999999;
		font-size: 32upx;
	}
	.text4{
		color: #333333;
		font-size: 32upx;
	}
	.people_Item{
		display: flex;
		align-items: center;
	}
	.people_Item image{
		width: 53upx;
		height: 53upx;
		border-radius: 50%;
		overflow: hidden;
		margin-left: 10upx;
	}
	.className{
		padding: 0 24upx;
		border-top: 1upx solid #E6E6E6;
		height: 88upx;
		line-height: 88upx;
		text-align: right;
		color: #333333;
		font-size: 28upx;
	}
</style>
